from game import *
from dynamic import Dynamic

class Player(Dynamic):

	def __init__(self, game, pos):
		Dynamic.__init__(self, game, globals.image_paths['player'], pos)

		self.health = 100.0
		self.fuel = 1000.0

	def update(self):
		mouse_button = pygame.mouse.get_pressed()
		mouse_force = Vector.list(pygame.mouse.get_rel())
	
		if mouse_button[2]:
			self.dam = 1
			self.mvel = globals.physics['player']['mvel_nofric']
		else: 
			self.dam = globals.physics['player']['damping']
			self.mvel = globals.physics['player']['mvel']
			
			
		self.apply_force(mouse_force / 50.0)

		self.ang = -self.vel.angle()
		self.flip = True if self.vel.x < 0 else False
		
		self.fuel -= 0.5
		
		Dynamic.update(self)
